{% extends 'base/base.html' %}
{% load static from staticfiles %}

<!doctype html>
<html>
<head>

    {% block  top %}
        <meta charset="utf8">
        <meta name="keywords" content=""/>
        <meta name="description" content="主题的个人博客模板，优雅、稳重、大气,低调。"/>
    {% endblock %}
    <title>个人博客</title>

    <link href="{% static 'css/base.css' %}" rel="stylesheet">
    <link href="{% static 'css/index.css' %}" rel="stylesheet">
    {% block jc %}
        <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}">
        <link rel="stylesheet" type="text/css" href="{% static 'css/style2.css' %}">
        <link rel="stylesheet" type="text/css" href="{% static 'css/font-awesome.min.css' %}">
        <link rel="apple-touch-icon-precomposed" href="{% static 'images/icon/icon.png' %}">
        <link rel="shortcut icon" href="{% static 'images/icon/favicon.ico' %}">
        <script src="{% static 'js/jquery-1.11.3/jquery.min.js' %}"></script>
    {% endblock %}

</head>

{% block body %}
    <body class="user-select" bgcolor="#EEE">
{% endblock %}

{% block header %}
    <header>
        <nav class="topnav" id="topnav"><a href="{% url 'App:index' %}"><span>首页</span><span
                class="en">Protal</span></a><a href="{% url 'App:aboutme' %}"><span>关于我</span><span
                class="en">About</span></a>
            <a href="{% url 'App:register' %}"><span>注册</span><span class="en">Learn</span></a>
            {#      在这里判断是否带session#}
            {% if usession %}
                <a href="{% url 'App:login' %}"><span>欢迎:{{ usession }}</span><span class="en">Learn</span></a>
                <a href="{% url 'App:logingout' %}"><span>退出</span><span class="en">Learn</span></a>
            {% else %}
                <a href="{% url 'App:login' %}"><span>登录</span><span class="en">Learn</span></a></nav>
            {% endif %}

    </header>
{% endblock %}

{% block content %}

    <section class="container-fluid">
        <div class="row">
            <aside class="col-sm-3 col-md-2 col-lg-2 sidebar">
                <ul class="nav nav-sidebar">
                    <li c<li class="active"><a href="{% url 'App:aboutme' %}">主页</a></li>
                    <li><a href="{% url 'App:article' %}">文章</a></li>
                    <li><a href="{% url 'App:mycomment' %}">评论</a></li>
                    <li><a href="{% url 'App:draft' %}">草稿箱</a></li>
                </ul>

            </aside>
            <div class="col-sm-9 col-sm-offset-3 col-md-10 col-lg-10 col-md-offset-2 main" id="main">
                <form action="/Comment/checkAll" method="post">
                    <h1 class="page-header">草稿箱 <span class="badge"></span></h1>
                    <div class="table-responsive">
                        <table class="table table-striped table-hover">
                            <thead>
                            <tr>
                                <th><span class="glyphicon glyphicon-th-large"></span> <span
                                        class="visible-lg">选择</span></th>
                                <th><span class="glyphicon glyphicon-file"></span> <span class="visible-lg">内容</span>
                                </th>
                                <th><span class="glyphicon glyphicon-time"></span> <span class="visible-lg">日期</span>
                                </th>
                                <th><span class="glyphicon glyphicon-pencil"></span> <span class="visible-lg">操作</span>
                                </th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for d in draft %}
                                <tr>
                                    <td>{{ d.id }}</td>
                                    <td class="article-title">{{ d.title }}</td>
                                    <td class="article-title">{{ d.content }}</td>
                                    <td>{{ d.pub_date }}</td>
                                    <a rel="1" name="delete">删除</a></td>
                                </tr>
                            {% endfor %}
                            <tr>
                                <td><input type="checkbox" class="input-control" name="checkbox[]" value=""/></td>
                                <td class="article-title">这是测试评论摘要这是测试评论摘要这是测试评论摘要这是测试评论摘要...</td>
                                <td>2015-12-03</td>
                                <td><a rel="2" name="see">查看</a> <a rel="2" name="delete">删除</a></td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </form>
            </div>
        </div>
    </section>
    <!--查看评论模态框-->
    <div class="modal fade" id="seeComment" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">查看评论</h4>
                </div>
                <div class="modal-body">
                    <table class="table" style="margin-bottom:0px;">
                        <thead>
                        <tr></tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td wdith="20%">评论ID:</td>
                            <td width="80%" class="see-comment-id"></td>
                        </tr>
                        <tr>
                            <td wdith="20%">评论页面:</td>
                            <td width="80%" class="see-comment-page"></td>
                        </tr>
                        <tr>
                            <td wdith="20%">评论内容:</td>
                            <td width="80%" class="see-comment-content"></td>
                        </tr>
                        <tr>
                            <td wdith="20%">IP:</td>
                            <td width="80%" class="see-comment-ip"></td>
                        </tr>
                        <tr>
                            <td wdith="20%">所在地:</td>
                            <td width="80%" class="see-comment-address"></td>
                        </tr>
                        <tr>
                            <td wdith="20%">系统:</td>
                            <td width="80%" class="see-comment-system"></td>
                        </tr>
                        <tr>
                            <td wdith="20%">浏览器:</td>
                            <td width="80%" class="see-comment-browser"></td>
                        </tr>
                        </tbody>
                        <tfoot>
                        <tr></tr>
                        </tfoot>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">朕已阅</button>
                </div>
            </div>
        </div>
    </div>
    <!--个人信息模态框-->
    <div class="modal fade" id="seeUserInfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <form action="" method="post">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">个人信息</h4>
                    </div>
                    <div class="modal-body">
                        <table class="table" style="margin-bottom:0px;">
                            <thead>
                            <tr></tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td wdith="20%">姓名:</td>
                                <td width="80%"><input type="text" value="王雨" class="form-control" name="truename"
                                                       maxlength="10" autocomplete="off"/></td>
                            </tr>
                            <tr>
                                <td wdith="20%">用户名:</td>
                                <td width="80%"><input type="text" value="admin" class="form-control" name="username"
                                                       maxlength="10" autocomplete="off"/></td>
                            </tr>
                            <tr>
                                <td wdith="20%">电话:</td>
                                <td width="80%"><input type="text" value="18538078281" class="form-control"
                                                       name="usertel" maxlength="13" autocomplete="off"/></td>
                            </tr>
                            <tr>
                                <td wdith="20%">旧密码:</td>
                                <td width="80%"><input type="password" class="form-control" name="old_password"
                                                       maxlength="18" autocomplete="off"/></td>
                            </tr>
                            <tr>
                                <td wdith="20%">新密码:</td>
                                <td width="80%"><input type="password" class="form-control" name="password"
                                                       maxlength="18" autocomplete="off"/></td>
                            </tr>
                            <tr>
                                <td wdith="20%">确认密码:</td>
                                <td width="80%"><input type="password" class="form-control" name="new_password"
                                                       maxlength="18" autocomplete="off"/></td>
                            </tr>
                            </tbody>
                            <tfoot>
                            <tr></tr>
                            </tfoot>
                        </table>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="submit" class="btn btn-primary">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!--个人登录记录模态框-->
    <div class="modal fade" id="seeUserLoginlog" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">登录记录</h4>
                </div>
                <div class="modal-body">
                    <table class="table" style="margin-bottom:0px;">
                        <thead>
                        <tr>
                            <th>登录IP</th>
                            <th>登录时间</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>::1:55570</td>
                            <td>2016-01-08 15:50:28</td>
                            <td>成功</td>
                        </tr>
                        <tr>
                            <td>::1:64377</td>
                            <td>2016-01-08 10:27:44</td>
                            <td>成功</td>
                        </tr>
                        <tr>
                            <td>::1:64027</td>
                            <td>2016-01-08 10:19:25</td>
                            <td>成功</td>
                        </tr>
                        <tr>
                            <td>::1:57081</td>
                            <td>2016-01-06 10:35:12</td>
                            <td>成功</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">朕已阅</button>
                </div>
            </div>
        </div>
    </div>
    <!--微信二维码模态框-->
    <div class="modal fade user-select" id="WeChat" tabindex="-1" role="dialog" aria-labelledby="WeChatModalLabel">
        <div class="modal-dialog" role="document" style="margin-top:120px;max-width:280px;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="WeChatModalLabel" style="cursor:default;">微信扫一扫</h4>
                </div>
                <div class="modal-body" style="text-align:center"><img src="images/weixin.jpg" alt=""
                                                                       style="cursor:pointer"/></div>
            </div>
        </div>
    </div>
    <!--提示模态框-->
    <div class="modal fade user-select" id="areDeveloping" tabindex="-1" role="dialog"
         aria-labelledby="areDevelopingModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="areDevelopingModalLabel" style="cursor:default;">该功能正在日以继夜的开发中…</h4>
                </div>
                <div class="modal-body"><img src="images/baoman/baoman_01.gif" alt="深思熟虑"/>
                    <p style="padding:15px 15px 15px 100px; position:absolute; top:15px; cursor:default;">
                        很抱歉，程序猿正在日以继夜的开发此功能，本程序将会在以后的版本中持续完善！</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-dismiss="modal">朕已阅</button>
                </div>
            </div>
        </div>
    </div>
    <!--右键菜单列表-->
    <div id="rightClickMenu">
        <ul class="list-group rightClickMenuList">
            <li class="list-group-item disabled">欢迎访问异清轩博客</li>
            <li class="list-group-item"><span>IP：</span>172.16.10.129</li>
            <li class="list-group-item"><span>地址：</span>河南省郑州市</li>
            <li class="list-group-item"><span>系统：</span>Windows10</li>
            <li class="list-group-item"><span>浏览器：</span>Chrome47</li>
        </ul>
    </div>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/admin-scripts.js"></script>
    <script>
        $(function () {
            $("#main table tbody tr td a").click(function () {
                var name = $(this);
                var id = name.attr("rel"); //对应id
                if (name.attr("name") === "see") {
                    $.ajax({
                        type: "POST",
                        url: "/Comment/see",
                        data: "id=" + id,
                        cache: false, //不缓存此页面
                        success: function (data) {
                            var data = JSON.parse(data);
                            $('.see-comment-id').html(data.id);
                            $('.see-comment-page').html(data.page);
                            $('.see-comment-content').html(data.content);
                            $('.see-comment-ip').html(data.ip);
                            $('.see-comment-address').html(data.address);
                            $('.see-comment-system').html(data.system);
                            $('.see-comment-browser').html(data.browser);
                            $('#seeComment').modal('show');
                        }
                    });
                } else if (name.attr("name") === "delete") {
                    if (window.confirm("此操作不可逆，是否确认？")) {
                        $.ajax({
                            type: "POST",
                            url: "/Comment/delete",
                            data: "id=" + id,
                            cache: false, //不缓存此页面
                            success: function (data) {
                                window.location.reload();
                            }
                        });
                    }
                    ;
                }
                ;
                return false;
            });
        });
    </script>
    </body>


{% endblock %}


{% block footer %}
{% endblock %}

</html>
